package Java9_11;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;

public class Work7 {
    public static void main(String[] args) {
        SimpleDateFormat s = new SimpleDateFormat("yyyy年MM月dd号");
        Scanner in = new Scanner(System.in);
        System.out.println("输入年份");
        int i=in.nextInt();
        Calendar calendar = Calendar.getInstance();
        calendar.set(i, 5, 1);
        int w=calendar.get(Calendar.DAY_OF_WEEK);
        while (w<3) {
            if (calendar.get(Calendar.DAY_OF_WEEK) == 1) {
                w++;
            }
            if (w < 3) {
                calendar.add(Calendar.DAY_OF_MONTH, 1);
            }
        }
        System.out.println(s.format(calendar.getTime()));
    }
}
